-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: update short guide of dev setup #3285
Conversation
On the Foundry-zksync install script, we probably need to add Update: Replacing Update: I'm waiting for write permissions to add this fix. It doesn't impact this PR though. Update: matter-labs/foundry-zksync#733 |
76bb5e9
to
a440e86
Compare
Weird. When running |
|
||
# Start Docker | ||
say "Starting Docker..." | ||
sudo systemctl start docker |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need to usermod
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIU the usermod change is just to be able to run docker commands without sudo. In fact, in my test machine, docker is running after this command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably user on your test machine has root access, and ability to run docker commands without sudo is super important, so it must be a part of initialization.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it important?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it's a major security prerequisite. Giving docker root access is a bad idea (and in general, you should never give sudo access to anything unless there is a strong request for it). And, well, it's just not convenient to have always run commands with sudo. Plus it will break e.g. zkstack
CLI because it will (correctly) run docker commands without sudo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding security, I'd argue exactly the reverse. With sudo you have to input a password for any docker command, thus requiring human approval. If you add the user to the docker group you effectively allow any app with non-root privileges access to the docker commands.
https://www.reddit.com/r/docker/comments/syngw7/to_sudo_or_not_to_sudo_that_is_the_question/
But yeah, if zkstack
breaks, then usermod
is needed.
Co-authored-by: Igor Aleksanov <[email protected]>
@Deniallugo Am I supposed to install prettier for zksync-era after installing ZK Stack CLI? |
@brunoffranca no you shouldn't, it just must exist in your system |
initializing the workspace, it's recommended that you read the whole guide below, as it provides more context and tips. | ||
|
||
If you run on 'clean' Ubuntu on GCP: | ||
Just run the following command on Debian-based Linux: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am also hesitatnt to suggest blindly running it. If the script will be run on a machine where, e.g., docker is already installed (especially if it was installed in some other way), it can mess up the configuration.
Do we really need to have a script here? If so, I'd probably want to make it fail-proof, e.g. that it won't do stuff that is not needed, but it's a much bigger effort.
The benefit of a code block is that you see the code and can choose what lines you need and what lines you don't need.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are to keep this, I'd add some big red warning that you should first read the script code and make sure that it does what you need (which though would render it much less helpful).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, but the original setup guide specifically says that the code is to be run on a fresh GCP instance. So it seems reasonable that we have a fast setup option for those cases at least.
I can add a code block below with what's in the script, so that people can inspect it though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Original -- yes, the new one removed mention of GCP.
Regarding code block -- it would mean duplication, and script will likely get out of sync with the code block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really think it's possible to create a fail-proof version of this script (at least without a disproportionate amount of work). And if we don't want duplication then the only possible solution is for me to close this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really think it's possible to create a fail-proof version of this script (at least without a disproportionate amount of work).
Yup, I agree, and that's exactly the reason why it wasn't done before.
And if we don't want duplication then the only possible solution is for me to close this PR.
Was there any reason why we need a script except for making usage simpler?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, just to make usage simpler. I created one for myself, since I have to run fresh dev nodes with some frequency, and thought it would be useful for more people.
# For VMs only! They don't have SSH keys, so we override SSH with HTTPS | ||
git config --global url."https://github.com/".insteadOf [email protected]: | ||
git config --global url."https://".insteadOf git:// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines are important for VMs, because submodule fetching may break if running on a fresh machine without valid ssh keys; however they're missing in the script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The standard now really is to declare submodules with https, like we do. I did follow the tree of submodules down and it seems all of them use https.
Do you think it's worth it to keep this, since it's such a small edge case?
What ❔
Updates the setup dev guide and turns it into a fully automated script. You just need to run one curl command and everything will be installed with no user input. Also fixed some minor issues with the previous guide:
--locked
flag to cargo-nextest installation since that's the recommended way.